#include "my_lib.h"
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>


void
swap_ints(int* a, int* b)
{
	int
	  T = *a;
	*a  = *b;
	*b  =  T;
}



void
gen_sorted(int* seq_sorted, int a_size)
{
	register int start = ( rand() - RAND_MAX/2 ) % 100;
	register int i = 0;
	while (i < a_size)
		seq_sorted[i++] = (start += rand() % 2);
}



void
gen_rev_sorted(int* seq_rev_sorted, int a_size)
{
	register int start = INT_MAX - 1 - ( rand() % 50 );
				/*
				 * rand() is in range [0, RAND_MAX]
				 */
	register int i = 0;
	while (i < a_size)
		seq_rev_sorted[i++] = (start -= rand() % 3);
}



void
gen_rand(int* seq_rand, int a_size)
{
	register int i = 0;
	while (i<a_size)
		seq_rand[i++] = rand();
}
